package main

import (
    "fmt"
    "log"
    // "net/http"

    // 确保 import 路径正确
    "grpc-jwt-yonghurenzheng/jwt_grpc_gin/config"
    "grpc-jwt-yonghurenzheng/jwt_grpc_gin/handlers" // 复用之前的JWT handlers

    "github.com/gin-gonic/gin"
)

func main() {
    config.InitDB()
    router := gin.Default()

    // 提供注册和登录接口
    router.POST("/register", handlers.Register)
    router.POST("/login", handlers.Login)

    port := "8081"
    fmt.Printf("🚀 Auth Service (Gin) 启动于 http://localhost:%s\n", port)
    if err := router.Run(":" + port); err != nil {
        log.Fatalf("服务启动失败: %v", err)
    }
}